#coding:utf-8
from tool import api
import webbrowser


def logo():
    print("""
 __  ___  __  .__   __.   _______   ______          .___________.  ______     ______    __      
|  |/  / |  | |  \ |  |  /  _____| /  __  \         |           | /  __  \   /  __  \  |  |     
|  '  /  |  | |   \|  | |  |  __  |  |  |  |  ______`---|  |----`|  |  |  | |  |  |  | |  |     
|    <   |  | |  . `  | |  | |_ | |  |  |  | |______|   |  |     |  |  |  | |  |  |  | |  |     
|  .  \  |  | |  |\   | |  |__| | |  `--'  |            |  |     |  `--'  | |  `--'  | |  `----.
|__|\__\ |__| |__| \__|  \______|  \______/             |__|      \______/   \______/  |_______|
             """
    )
    print('\t\t\t\t\t\t-by xiaowang')

#使用加密文件
def enc_js():
    enc_path = api.root_path / "ZZIFE_ENC(success).js"
    f = open(enc_path, 'r', encoding='UTF-8')
    line = f.readline()
    html = ''
    while line:
        html = html + line
        line = f.readline()
    return html

#写文件
def to_write(file_path,out_path):
    file = open(str(file_path),'r')
    content = file.read()
    data = content
    #  写入文件
    text_file = open(str(out_path), "w+")
    text_file.write(data)
    text_file.close()

#用浏览器打开html文件
def show_html(file):
    webbrowser.open_new_tab(str(file))